package dk.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.ReturnData.ResponseData;

import dk.service.*;

@RestController
@RequestMapping("api")
public class SubjectController {
@Autowired
ApiService apiservice;
@PostMapping("/GetSubject")
public ResponseData GetSubject() {
	return apiservice.GetSubject();
}
@PostMapping("/GetSubjectByPage")
public ResponseData GetSubjectBypage(Integer pagenum,Integer count) {
	return apiservice.GetSubjectByPage(pagenum,count);
}
@PostMapping("GetSubjectCount")
public ResponseData GetSubjectCount () {
	return apiservice.GetSubjectCount();
}
@PostMapping("AddSubject")
public ResponseData AddSubject(String name) {
	return apiservice.AddSubject(name);
}
@PostMapping("SearchSubjectListBySubjectNameByPage")
public ResponseData SearchSubjectListBySubjectNameByPage(String name,Integer pagenum,Integer count) {
	return apiservice.SearchSubjectListBySubjectNameByPage(name,pagenum,count);
}
@PostMapping("DeleteSubjectListById")
public ResponseData  DeleteSubjectListById (Integer id) {
	return apiservice.DeleteSubjectListById(id);
}
@PostMapping("GetSubjectById")
public ResponseData GetSubjectById(Integer id) {
	
	return apiservice.GetSubjectById(id);
}
@PostMapping("EditSubjectById")
public ResponseData GetSubjectById(Integer id,String url,String name){
	return apiservice.EditSubjectByid(id,url,name);
	
}


}
